#pragma once
#include "allocator.h"
#include "X86_Defination.h"

#define OPCODE_DR0 0
#define OPCODE_DR1 1
#define OPCODE_DR2 2
#define OPCODE_DR3 3
#define OPCODE_DR4 4
#define OPCODE_DR5 5
#define OPCODE_DR6 6
#define OPCODE_DR7 7
#define OPCODE_EAX 0
#define OPCODE_ECX 1
#define OPCODE_EDX 2
#define OPCODE_EBX 3
#define OPCODE_ESP 4
#define OPCODE_EBP 5
#define OPCODE_ESI 6
#define OPCODE_EDI 7

class X86_Machine
{
	static X86_Machine* _instance;
public:
	static X86_Machine* Instance();
private:
	DELCARE_SUPPORT_ALLOCATOR
	X86_Machine(void);
	~X86_Machine(void);
public:
	static void GetIdt(PIDT pIdt);
	static void SetDebugRegister(unsigned DrX, UINT32 v);
	static inline void SetDr0(UINT32 v);
	static inline void SetDr1(UINT32 v);
	static inline void SetDr2(UINT32 v);
	static inline void SetDr3(UINT32 v);
	static inline void SetDr4(UINT32 v);
	static inline void SetDr5(UINT32 v);
	static inline void SetDr6(UINT32 v);
	static inline void SetDr7(UINT32 v);
	static UINT32 GetDebugRegister(unsigned DrX);
	static inline UINT32 GetDr0();
	static inline UINT32 GetDr1();
	static inline UINT32 GetDr2();
	static inline UINT32 GetDr3();
	static inline UINT32 GetDr4();
	static inline UINT32 GetDr5();
	static inline UINT32 GetDr6();
	static inline UINT32 GetDr7();
};
